\(\int \frac {(d+e x)^2}{\sqrt {a+b x+c x^2}} \, dx\) [2375]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [B] (verification not implemented)
   Maxima [F(-2)]
   Giac [A] (verification not implemented)
   Mupad [F(-1)]

Optimal result

Integrand size = 22, antiderivative size = 127 \[ \int \frac {(d+e x)^2}{\sqrt {a+b x+c x^2}} \, dx=\frac {3 e (2 c d-b e) \sqrt {a+b x+c x^2}}{4 c^2}+\frac {e (d+e x) \sqrt {a+b x+c x^2}}{2 c}+\frac {\left (8 c^2 d^2+3 b^2 e^2-4 c e (2 b d+a e)\right ) \text {arctanh}\left (\frac {b+2 c x}{2 \sqrt {c} \sqrt {a+b x+c x^2}}\right )}{8 c^{5/2}} \]

[Out]

1/8*(8*c^2*d^2+3*b^2*e^2-4*c*e*(a*e+2*b*d))*arctanh(1/2*(2*c*x+b)/c^(1/2)/(c*x^2+b*x+a)^(1/2))/c^(5/2)+3/4*e*(
-b*e+2*c*d)*(c*x^2+b*x+a)^(1/2)/c^2+1/2*e*(e*x+d)*(c*x^2+b*x+a)^(1/2)/c

Rubi [A] (verified)

Time = 0.07 (sec) , antiderivative size = 127, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 4, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.182, Rules used = {756, 654, 635, 212} \[ \int \frac {(d+e x)^2}{\sqrt {a+b x+c x^2}} \, dx=\frac {\text {arctanh}\left (\frac {b+2 c x}{2 \sqrt {c} \sqrt {a+b x+c x^2}}\right ) \left (-4 c e (a e+2 b d)+3 b^2 e^2+8 c^2 d^2\right )}{8 c^{5/2}}+\frac {3 e \sqrt {a+b x+c x^2} (2 c d-b e)}{4 c^2}+\frac {e (d+e x) \sqrt {a+b x+c x^2}}{2 c} \]

[In]

Int[(d + e*x)^2/Sqrt[a + b*x + c*x^2],x]

[Out]

(3*e*(2*c*d - b*e)*Sqrt[a + b*x + c*x^2])/(4*c^2) + (e*(d + e*x)*Sqrt[a + b*x + c*x^2])/(2*c) + ((8*c^2*d^2 +
3*b^2*e^2 - 4*c*e*(2*b*d + a*e))*ArcTanh[(b + 2*c*x)/(2*Sqrt[c]*Sqrt[a + b*x + c*x^2])])/(8*c^(5/2))

Rule 212

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[-b, 2]))*ArcTanh[Rt[-b, 2]*(x/Rt[a, 2])], x]
 /; FreeQ[{a, b}, x] && NegQ[a/b] && (GtQ[a, 0] || LtQ[b, 0])

Rule 635

Int[1/Sqrt[(a_) + (b_.)*(x_) + (c_.)*(x_)^2], x_Symbol] :> Dist[2, Subst[Int[1/(4*c - x^2), x], x, (b + 2*c*x)
/Sqrt[a + b*x + c*x^2]], x] /; FreeQ[{a, b, c}, x] && NeQ[b^2 - 4*a*c, 0]

Rule 654

Int[((d_.) + (e_.)*(x_))*((a_.) + (b_.)*(x_) + (c_.)*(x_)^2)^(p_), x_Symbol] :> Simp[e*((a + b*x + c*x^2)^(p +
 1)/(2*c*(p + 1))), x] + Dist[(2*c*d - b*e)/(2*c), Int[(a + b*x + c*x^2)^p, x], x] /; FreeQ[{a, b, c, d, e, p}
, x] && NeQ[2*c*d - b*e, 0] && NeQ[p, -1]

Rule 756

Int[((d_.) + (e_.)*(x_))^(m_)*((a_.) + (b_.)*(x_) + (c_.)*(x_)^2)^(p_), x_Symbol] :> Simp[e*(d + e*x)^(m - 1)*
((a + b*x + c*x^2)^(p + 1)/(c*(m + 2*p + 1))), x] + Dist[1/(c*(m + 2*p + 1)), Int[(d + e*x)^(m - 2)*Simp[c*d^2
*(m + 2*p + 1) - e*(a*e*(m - 1) + b*d*(p + 1)) + e*(2*c*d - b*e)*(m + p)*x, x]*(a + b*x + c*x^2)^p, x], x] /;
FreeQ[{a, b, c, d, e, m, p}, x] && NeQ[b^2 - 4*a*c, 0] && NeQ[c*d^2 - b*d*e + a*e^2, 0] && NeQ[2*c*d - b*e, 0]
 && If[RationalQ[m], GtQ[m, 1], SumSimplerQ[m, -2]] && NeQ[m + 2*p + 1, 0] && IntQuadraticQ[a, b, c, d, e, m,
p, x]

Rubi steps \begin{align*} \text {integral}& = \frac {e (d+e x) \sqrt {a+b x+c x^2}}{2 c}+\frac {\int \frac {\frac {1}{2} \left (4 c d^2-e (b d+2 a e)\right )+\frac {3}{2} e (2 c d-b e) x}{\sqrt {a+b x+c x^2}} \, dx}{2 c} \\ & = \frac {3 e (2 c d-b e) \sqrt {a+b x+c x^2}}{4 c^2}+\frac {e (d+e x) \sqrt {a+b x+c x^2}}{2 c}+\frac {\left (-\frac {3}{2} b e (2 c d-b e)+c \left (4 c d^2-e (b d+2 a e)\right )\right ) \int \frac {1}{\sqrt {a+b x+c x^2}} \, dx}{4 c^2} \\ & = \frac {3 e (2 c d-b e) \sqrt {a+b x+c x^2}}{4 c^2}+\frac {e (d+e x) \sqrt {a+b x+c x^2}}{2 c}+\frac {\left (-\frac {3}{2} b e (2 c d-b e)+c \left (4 c d^2-e (b d+2 a e)\right )\right ) \text {Subst}\left (\int \frac {1}{4 c-x^2} \, dx,x,\frac {b+2 c x}{\sqrt {a+b x+c x^2}}\right )}{2 c^2} \\ & = \frac {3 e (2 c d-b e) \sqrt {a+b x+c x^2}}{4 c^2}+\frac {e (d+e x) \sqrt {a+b x+c x^2}}{2 c}+\frac {\left (8 c^2 d^2+3 b^2 e^2-4 c e (2 b d+a e)\right ) \tanh ^{-1}\left (\frac {b+2 c x}{2 \sqrt {c} \sqrt {a+b x+c x^2}}\right )}{8 c^{5/2}} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.38 (sec) , antiderivative size = 106, normalized size of antiderivative = 0.83 \[ \int \frac {(d+e x)^2}{\sqrt {a+b x+c x^2}} \, dx=\frac {2 \sqrt {c} e (8 c d-3 b e+2 c e x) \sqrt {a+x (b+c x)}+\left (-8 c^2 d^2-3 b^2 e^2+4 c e (2 b d+a e)\right ) \log \left (c^2 \left (b+2 c x-2 \sqrt {c} \sqrt {a+x (b+c x)}\right )\right )}{8 c^{5/2}} \]

[In]

Integrate[(d + e*x)^2/Sqrt[a + b*x + c*x^2],x]

[Out]

(2*Sqrt[c]*e*(8*c*d - 3*b*e + 2*c*e*x)*Sqrt[a + x*(b + c*x)] + (-8*c^2*d^2 - 3*b^2*e^2 + 4*c*e*(2*b*d + a*e))*
Log[c^2*(b + 2*c*x - 2*Sqrt[c]*Sqrt[a + x*(b + c*x)])])/(8*c^(5/2))

Maple [A] (verified)

Time = 0.30 (sec) , antiderivative size = 94, normalized size of antiderivative = 0.74

method result size
risch \(-\frac {e \left (-2 c e x +3 b e -8 c d \right ) \sqrt {c \,x^{2}+b x +a}}{4 c^{2}}-\frac {\left (4 a c \,e^{2}-3 b^{2} e^{2}+8 b c d e -8 c^{2} d^{2}\right ) \ln \left (\frac {\frac {b}{2}+c x}{\sqrt {c}}+\sqrt {c \,x^{2}+b x +a}\right )}{8 c^{\frac {5}{2}}}\) \(94\)
default \(\frac {d^{2} \ln \left (\frac {\frac {b}{2}+c x}{\sqrt {c}}+\sqrt {c \,x^{2}+b x +a}\right )}{\sqrt {c}}+e^{2} \left (\frac {x \sqrt {c \,x^{2}+b x +a}}{2 c}-\frac {3 b \left (\frac {\sqrt {c \,x^{2}+b x +a}}{c}-\frac {b \ln \left (\frac {\frac {b}{2}+c x}{\sqrt {c}}+\sqrt {c \,x^{2}+b x +a}\right )}{2 c^{\frac {3}{2}}}\right )}{4 c}-\frac {a \ln \left (\frac {\frac {b}{2}+c x}{\sqrt {c}}+\sqrt {c \,x^{2}+b x +a}\right )}{2 c^{\frac {3}{2}}}\right )+2 d e \left (\frac {\sqrt {c \,x^{2}+b x +a}}{c}-\frac {b \ln \left (\frac {\frac {b}{2}+c x}{\sqrt {c}}+\sqrt {c \,x^{2}+b x +a}\right )}{2 c^{\frac {3}{2}}}\right )\) \(194\)

[In]

int((e*x+d)^2/(c*x^2+b*x+a)^(1/2),x,method=_RETURNVERBOSE)

[Out]

-1/4*e*(-2*c*e*x+3*b*e-8*c*d)*(c*x^2+b*x+a)^(1/2)/c^2-1/8*(4*a*c*e^2-3*b^2*e^2+8*b*c*d*e-8*c^2*d^2)/c^(5/2)*ln
((1/2*b+c*x)/c^(1/2)+(c*x^2+b*x+a)^(1/2))

Fricas [A] (verification not implemented)

none

Time = 0.28 (sec) , antiderivative size = 247, normalized size of antiderivative = 1.94 \[ \int \frac {(d+e x)^2}{\sqrt {a+b x+c x^2}} \, dx=\left [-\frac {{\left (8 \, c^{2} d^{2} - 8 \, b c d e + {\left (3 \, b^{2} - 4 \, a c\right )} e^{2}\right )} \sqrt {c} \log \left (-8 \, c^{2} x^{2} - 8 \, b c x - b^{2} + 4 \, \sqrt {c x^{2} + b x + a} {\left (2 \, c x + b\right )} \sqrt {c} - 4 \, a c\right ) - 4 \, {\left (2 \, c^{2} e^{2} x + 8 \, c^{2} d e - 3 \, b c e^{2}\right )} \sqrt {c x^{2} + b x + a}}{16 \, c^{3}}, -\frac {{\left (8 \, c^{2} d^{2} - 8 \, b c d e + {\left (3 \, b^{2} - 4 \, a c\right )} e^{2}\right )} \sqrt {-c} \arctan \left (\frac {\sqrt {c x^{2} + b x + a} {\left (2 \, c x + b\right )} \sqrt {-c}}{2 \, {\left (c^{2} x^{2} + b c x + a c\right )}}\right ) - 2 \, {\left (2 \, c^{2} e^{2} x + 8 \, c^{2} d e - 3 \, b c e^{2}\right )} \sqrt {c x^{2} + b x + a}}{8 \, c^{3}}\right ] \]

[In]

integrate((e*x+d)^2/(c*x^2+b*x+a)^(1/2),x, algorithm="fricas")

[Out]

[-1/16*((8*c^2*d^2 - 8*b*c*d*e + (3*b^2 - 4*a*c)*e^2)*sqrt(c)*log(-8*c^2*x^2 - 8*b*c*x - b^2 + 4*sqrt(c*x^2 +
b*x + a)*(2*c*x + b)*sqrt(c) - 4*a*c) - 4*(2*c^2*e^2*x + 8*c^2*d*e - 3*b*c*e^2)*sqrt(c*x^2 + b*x + a))/c^3, -1
/8*((8*c^2*d^2 - 8*b*c*d*e + (3*b^2 - 4*a*c)*e^2)*sqrt(-c)*arctan(1/2*sqrt(c*x^2 + b*x + a)*(2*c*x + b)*sqrt(-
c)/(c^2*x^2 + b*c*x + a*c)) - 2*(2*c^2*e^2*x + 8*c^2*d*e - 3*b*c*e^2)*sqrt(c*x^2 + b*x + a))/c^3]

Sympy [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 243 vs. \(2 (116) = 232\).

Time = 0.61 (sec) , antiderivative size = 243, normalized size of antiderivative = 1.91 \[ \int \frac {(d+e x)^2}{\sqrt {a+b x+c x^2}} \, dx=\begin {cases} \left (\frac {e^{2} x}{2 c} + \frac {- \frac {3 b e^{2}}{4 c} + 2 d e}{c}\right ) \sqrt {a + b x + c x^{2}} + \left (- \frac {a e^{2}}{2 c} - \frac {b \left (- \frac {3 b e^{2}}{4 c} + 2 d e\right )}{2 c} + d^{2}\right ) \left (\begin {cases} \frac {\log {\left (b + 2 \sqrt {c} \sqrt {a + b x + c x^{2}} + 2 c x \right )}}{\sqrt {c}} & \text {for}\: a - \frac {b^{2}}{4 c} \neq 0 \\\frac {\left (\frac {b}{2 c} + x\right ) \log {\left (\frac {b}{2 c} + x \right )}}{\sqrt {c \left (\frac {b}{2 c} + x\right )^{2}}} & \text {otherwise} \end {cases}\right ) & \text {for}\: c \neq 0 \\\frac {2 \left (\frac {e^{2} \left (a + b x\right )^{\frac {5}{2}}}{5 b^{2}} + \frac {\left (a + b x\right )^{\frac {3}{2}} \left (- 2 a e^{2} + 2 b d e\right )}{3 b^{2}} + \frac {\sqrt {a + b x} \left (a^{2} e^{2} - 2 a b d e + b^{2} d^{2}\right )}{b^{2}}\right )}{b} & \text {for}\: b \neq 0 \\\frac {\begin {cases} d^{2} x & \text {for}\: e = 0 \\\frac {\left (d + e x\right )^{3}}{3 e} & \text {otherwise} \end {cases}}{\sqrt {a}} & \text {otherwise} \end {cases} \]

[In]

integrate((e*x+d)**2/(c*x**2+b*x+a)**(1/2),x)

[Out]

Piecewise(((e**2*x/(2*c) + (-3*b*e**2/(4*c) + 2*d*e)/c)*sqrt(a + b*x + c*x**2) + (-a*e**2/(2*c) - b*(-3*b*e**2
/(4*c) + 2*d*e)/(2*c) + d**2)*Piecewise((log(b + 2*sqrt(c)*sqrt(a + b*x + c*x**2) + 2*c*x)/sqrt(c), Ne(a - b**
2/(4*c), 0)), ((b/(2*c) + x)*log(b/(2*c) + x)/sqrt(c*(b/(2*c) + x)**2), True)), Ne(c, 0)), (2*(e**2*(a + b*x)*
*(5/2)/(5*b**2) + (a + b*x)**(3/2)*(-2*a*e**2 + 2*b*d*e)/(3*b**2) + sqrt(a + b*x)*(a**2*e**2 - 2*a*b*d*e + b**
2*d**2)/b**2)/b, Ne(b, 0)), (Piecewise((d**2*x, Eq(e, 0)), ((d + e*x)**3/(3*e), True))/sqrt(a), True))

Maxima [F(-2)]

Exception generated. \[ \int \frac {(d+e x)^2}{\sqrt {a+b x+c x^2}} \, dx=\text {Exception raised: ValueError} \]

[In]

integrate((e*x+d)^2/(c*x^2+b*x+a)^(1/2),x, algorithm="maxima")

[Out]

Exception raised: ValueError >> Computation failed since Maxima requested additional constraints; using the 'a
ssume' command before evaluation *may* help (example of legal syntax is 'assume(4*a*c-b^2>0)', see `assume?` f
or more deta

Giac [A] (verification not implemented)

none

Time = 0.31 (sec) , antiderivative size = 105, normalized size of antiderivative = 0.83 \[ \int \frac {(d+e x)^2}{\sqrt {a+b x+c x^2}} \, dx=\frac {1}{4} \, \sqrt {c x^{2} + b x + a} {\left (\frac {2 \, e^{2} x}{c} + \frac {8 \, c d e - 3 \, b e^{2}}{c^{2}}\right )} - \frac {{\left (8 \, c^{2} d^{2} - 8 \, b c d e + 3 \, b^{2} e^{2} - 4 \, a c e^{2}\right )} \log \left ({\left | 2 \, {\left (\sqrt {c} x - \sqrt {c x^{2} + b x + a}\right )} \sqrt {c} + b \right |}\right )}{8 \, c^{\frac {5}{2}}} \]

[In]

integrate((e*x+d)^2/(c*x^2+b*x+a)^(1/2),x, algorithm="giac")

[Out]

1/4*sqrt(c*x^2 + b*x + a)*(2*e^2*x/c + (8*c*d*e - 3*b*e^2)/c^2) - 1/8*(8*c^2*d^2 - 8*b*c*d*e + 3*b^2*e^2 - 4*a
*c*e^2)*log(abs(2*(sqrt(c)*x - sqrt(c*x^2 + b*x + a))*sqrt(c) + b))/c^(5/2)

Mupad [F(-1)]

Timed out. \[ \int \frac {(d+e x)^2}{\sqrt {a+b x+c x^2}} \, dx=\int \frac {{\left (d+e\,x\right )}^2}{\sqrt {c\,x^2+b\,x+a}} \,d x \]

[In]

int((d + e*x)^2/(a + b*x + c*x^2)^(1/2),x)

[Out]

int((d + e*x)^2/(a + b*x + c*x^2)^(1/2), x)